-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't track local_needs_drop separately in qualify_consts. #47306
Conversation
@@ -538,7 +538,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> { | |||
|
|||
// Mark the consumed locals to indicate later drops are noops. | |||
if let Place::Local(local) = *place { | |||
self.local_needs_drop[local] = None; | |||
self.local_needs_drop.remove(local.index()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I feel like this shouldn't happen unless we have a Move
. Also, we can probably "just" remove NEEDS_DROP
here from self.temp_qualif[local]
, and check that later, instead of having a separate bitvec.
0ac224b
to
7f866a2
Compare
7f866a2
to
27aee25
Compare
@@ -844,12 +845,14 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> { | |||
|
|||
// Deny *any* live drops anywhere other than functions. | |||
if self.mode != Mode::Fn { | |||
// HACK(eddyb) Emulate a bit of dataflow analysis, | |||
// conservatively, that drop elaboration will do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to keep this comment around because this is still emulated until we use something more like what drop elaboration does.
27aee25
to
3695278
Compare
pub const fn drop<T>(_: T) {} | ||
|
||
pub const fn drop2<T>(x: T) { | ||
(x, ()).1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add //~^ ERROR
comments (assuming they get caught now).
dab557d
to
5038760
Compare
Tests passing. LGTM, @eddyb! |
19a71a8
to
e2c1a93
Compare
@bors r+ |
📌 Commit e2c1a93 has been approved by |
Don't track local_needs_drop separately in qualify_consts. None
No description provided.